package br.com.io.writeterandreader;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.text.DateFormat;
import java.util.Date;

public class EscreverArquivo {

	public static void main(String[] args) {
		
		try {
			DateFormat df = DateFormat.getTimeInstance();
			String txt = df.format(new Date());
			FileWriter fw = new FileWriter("arquivo.txt",true);
			PrintWriter pw = new PrintWriter(fw);
			pw.println();
			fw.write(txt);
			
			fw.close();
			pw.write("\nteste");
			System.out.println(pw.checkError());
			pw.close();
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
			
			
	
		
	}
	
}
